# 用户管理相关页面测试
from Lib.base.keywords import KeyWords
from selenium.webdriver.common.by import By
from Lib.common.common_function import *
from Lib.base.page_object.login_page import LonginPage
import uuid
import random


class SlagCarManage(KeyWords):
    url = KeyWords.url + 'mudtruck-database/list/white'

    # 新建处置证
    def create_disposal(self):
        '''
        现建处置证
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\slag_car_manage\create_disposal.yaml')
        element_operation(self, data[0]['data'])

    # 处置证列表
    def disposal_list(self):
        '''
        查看处置证列表
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\slag_car_manage\disposal_list.yaml')
        element_operation(self, data[0]['data'])

    # 处置证列表
    def disposal_update(self):
        '''
        查看处置证列表
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\slag_car_manage\disposal_update.yaml')
        element_operation(self, data[0]['data'])

    # 处置证列表
    def slag_car_list(self):
        '''
        查看处置证列表
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\slag_car_manage\slag_car_list.yaml')
        element_operation(self, data[0]['data'])

    # 删除处置处置证
    def disposal_delete(self):
        '''
        查看处置证列表
        :return:
        '''
        data = get_data_by_yaml(get_path() + r'\Data\element_data\slag_car_manage\disposal_delete.yaml')
        element_operation(self, data[0]['data'])


if __name__ == '__main__':
    try:
        driver = choose_browser()
        L = LonginPage(driver)
        L.login('kobeAdmin002', 'kobe8888')
        case = SlagCarManage(driver)
        case.slag_car_delete()
    except:
        driver.quit()
    else:
        driver.quit()
